import 'package:cms/models/term.dart';
import 'package:common/export/http.dart';

class LaraPressTermApi {
  static const String term = '/v1/term/';
  Future<LarapressListResponse<WpTerm>> getTerms(
    Map<String, dynamic> params,
  ) async {
    return await LaraPressHttp.instance.dio.getList(
      term,
      queryParameters: params,
      fromJson: WpTerm.fromJson,
    );
  }

  Future<LarapressResponse<WpTerm>> getTerm(int id) async {
    return await LaraPressHttp.instance.dio.get(
      '$term/$id',
      fromJson: WpTerm.fromJson,
    );
  }
}
